package com.test.test.utils;

import com.test.test.utils.emums.BaseEnum;

public class EmumUtil {
	public static <T extends BaseEnum> T getByCode(Integer code, Class<T> enumClass) {
		for (T each : enumClass.getEnumConstants()) {
			if (code.equals(each.getCode())) {
				return each;
			}
		}
		return null;
	}
}
